package com.blog.cloud.chat.handler;

import com.blog.cloud.chat.constant.AuthConstant;
import com.blog.cloud.chat.message.auth.AuthRequest;
import jakarta.websocket.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 认证请求消息处理
 */
@Component
public class AuthRequestHandler implements MessageHandler<AuthRequest>{

    private final Logger logger = LoggerFactory.getLogger(AuthRequestHandler.class);

    @Override
    public void execute(Session session, AuthRequest message) {
        logger.info("AuthRequestHandler.execute the message");
        // 从请求参数中获取认证信息
        session.getRequestParameterMap().get(AuthConstant.ACCESS_TOKEN);

    }

    @Override
    public String getType() {
        return null;
    }
}
